﻿using Prism.Mvvm;
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Common.Device.ViewModels
{
    public class FctViewModel : BindableBase
    {
        private int menuIndex = 0;
        /// <summary>
        /// 菜单索引
        /// </summary>
        public int MenuIndex
        {
            get { return menuIndex; }
            set { SetProperty(ref menuIndex, value); }
        }
        private bool hasJdq = false;
        /// <summary>
        /// 是否有继电器功能
        /// </summary>
        public bool HasJdq
        {
            get { return hasJdq; }
            set { SetProperty(ref hasJdq, value); }
        }
        private bool hasDp = false;
        /// <summary>
        /// 是否有电平采集功能
        /// </summary>
        public bool HasDp
        {
            get { return hasDp; }
            set { SetProperty(ref hasDp, value); }
        }
        private ObservableCollection<int> dpChannels = new ObservableCollection<int>() { 1 };
        /// <summary>
        /// 电平采集通道集合
        /// </summary>
        public ObservableCollection<int> DpChannels
        {
            get { return dpChannels; }
            set { SetProperty(ref dpChannels, value); }
        }
        private int dpChannel = 1;
        /// <summary>
        /// 电平采集通道
        /// </summary>
        public int DpChannel
        {
            get { return dpChannel; }
            set { SetProperty(ref dpChannel, value); }
        }
        public ObservableCollection<string> DpStates { get; set; } = new ObservableCollection<string> { "高电平", "低电平" };

        private string dpState = "高电平";
        /// <summary>
        /// 期望电平
        /// </summary>
        public string DpState
        {
            get { return dpState; }
            set { SetProperty(ref dpState, value); }
        }
        private string closeChannel = "";
        /// <summary>
        /// 断开继电器通道
        /// </summary>
        public string CloseChannel
        {
            get { return closeChannel; }
            set { SetProperty(ref closeChannel, value); }
        }
        private string openChannel = "";
        /// <summary>
        /// 闭合继电器通道
        /// </summary>
        public string OpenChannel
        {
            get { return openChannel; }
            set { SetProperty(ref openChannel, value); }
        }
    }
}
